1
00:00:01,310 --> 00:00:03,830
Welcome to this brand new module.

2
00:00:03,830 --> 00:00:06,470
So let's talk about what's coming up.

3
00:00:06,470 --> 00:00:10,620
If you remember we did a whole lot of work in the previous modules.

4
00:00:10,650 --> 00:00:16,280
Now we weren't exactly tilling the land but we did the machine learning equivalent with the amnesty

5
00:00:16,330 --> 00:00:23,360
data set for recognizing handwritten digits namely we built a neural network in the form of a multilayer

6
00:00:23,360 --> 00:00:24,220
perception.

7
00:00:24,740 --> 00:00:27,980
And we did all of this in Jupiter notebook.

8
00:00:27,980 --> 00:00:34,340
There we set up the layers and then we defined our loss and optimization metrics.

9
00:00:34,340 --> 00:00:42,690
And then we went on to train our model and while our training was happening we were analyzing and evaluating

10
00:00:42,690 --> 00:00:45,560
our model's performance using tensor board.

11
00:00:45,570 --> 00:00:50,070
Now all of this hard work is going to be the foundation for what we're going to do now.

12
00:00:50,130 --> 00:00:56,060
At this point we are ready to really reap the fruits of our labor because in this module we're going

13
00:00:56,060 --> 00:00:59,240
to take the final step in our machine learning workflow.

14
00:00:59,370 --> 00:01:05,580
We're actually going to deploy our model and what I mean by that I mean that at the moment our model

15
00:01:05,580 --> 00:01:07,650
is sitting on our local computer.

16
00:01:07,650 --> 00:01:12,910
But we could also send it out into the world and get it to do some real work.

17
00:01:12,930 --> 00:01:19,530
And by that I mean creating a Web site where our model gets to predict some handwritten digits on some

18
00:01:19,530 --> 00:01:27,210
real life data but this will allow us to do is turn our machine learning model into an actual product.

19
00:01:27,210 --> 00:01:33,130
And we're going to do just that by creating a Web site called Math garden.

20
00:01:33,150 --> 00:01:40,350
And on this website kids or anyone really can practice their math skills by writing a digit into this

21
00:01:40,350 --> 00:01:41,950
black box here.

22
00:01:41,970 --> 00:01:45,870
So four plus two that is equal to six.

23
00:01:46,110 --> 00:01:52,710
And I can check my answer and if my answer is correct then our garden will start to grow.

24
00:01:52,800 --> 00:01:54,980
Two plus three is equal to five.

25
00:01:55,290 --> 00:02:01,110
And if I click check answer then we can see that our garden continues to grow.

26
00:02:01,110 --> 00:02:03,330
But what if we get it wrong three plus zero.

27
00:02:03,420 --> 00:02:08,570
What if that's equal to two instead of three then machine learning model.

28
00:02:08,580 --> 00:02:11,000
Well take a look at what's in this black box.

29
00:02:11,620 --> 00:02:16,140
And because we've got a wrong our garden will start to wither.

30
00:02:16,140 --> 00:02:17,830
So that's awesome right.

31
00:02:17,850 --> 00:02:24,030
So this is a really really neat application of the model that you've trained and that you've got already

32
00:02:24,240 --> 00:02:30,210
because now you can put it to work and make it predict what's in this box here and give it a purpose

33
00:02:30,450 --> 00:02:32,040
make it go live.

34
00:02:32,100 --> 00:02:38,490
And by the end of this module you'll be able to publish this Web site so that you get an actual your

35
00:02:38,490 --> 00:02:44,700
URL that you can then send to your friends and family and also show it off to potential employers as

36
00:02:44,700 --> 00:02:45,930
part of your portfolio.

37
00:02:46,500 --> 00:02:51,540
So now let's talk a little bit about the workflow of what we're going to be doing in this module how

38
00:02:51,540 --> 00:02:57,360
we're going to get to that final step where we publish our Web site and bring our product into the world

39
00:02:57,620 --> 00:02:58,300
first.

40
00:02:58,350 --> 00:03:01,760
Let's talk about saving and loading our models.

41
00:03:01,770 --> 00:03:03,270
Why is this useful.

42
00:03:03,270 --> 00:03:08,040
Well oftentimes training takes an incredibly long time.

43
00:03:08,220 --> 00:03:13,740
And after you've trained a model you want to be able to save or export that trained model.

44
00:03:13,740 --> 00:03:19,230
And conversely oftentimes you want to be able to load a model so that you can pick up training where

45
00:03:19,230 --> 00:03:20,280
you left off.

46
00:03:20,310 --> 00:03:24,720
This is the bit of the module where we're still going to be working in Jupiter notebook.

47
00:03:24,720 --> 00:03:29,910
I'm going to show you how you can save and export your amnesty model that you've trained.

48
00:03:29,910 --> 00:03:35,310
But step two is going to be deploying this model to the browser and this means getting our model to

49
00:03:35,310 --> 00:03:40,430
be able to work in Chrome Firefox or Microsoft Edge for example.

50
00:03:40,440 --> 00:03:46,380
Now there's one caveat for this step because we can't actually use regular tensor flow in our browsers

51
00:03:46,620 --> 00:03:47,180
for this.

52
00:03:47,190 --> 00:03:53,520
We need a version of tensor flow called tensor float J S and this will mean converting our model into

53
00:03:53,520 --> 00:03:54,260
a tensor flow.

54
00:03:54,250 --> 00:04:00,290
Yes so that it can be used on the web because that J.S. Pont stands for JavaScript.

55
00:04:00,360 --> 00:04:06,760
Speaking of JavaScript that's the programming language that we're gonna be using to build our Web site.

56
00:04:07,110 --> 00:04:10,710
And that's going to be step three as part of this workflow.

57
00:04:10,920 --> 00:04:18,510
We're going to be using HDMI all CSX and javascript to create our math garden Web site.

58
00:04:18,510 --> 00:04:24,180
This will involve writing the code to style our Web site writing the code to create this little canvas

59
00:04:24,180 --> 00:04:31,850
here where you can draw an image and also writing the logic of course to check the answers.

60
00:04:31,860 --> 00:04:37,980
Now this is not a web development course but not to worry we're gonna be keeping it simple and we'll

61
00:04:37,980 --> 00:04:39,350
stick to the basics.

62
00:04:39,420 --> 00:04:45,310
And besides now that you already know Python you're going to see all the same programming concepts apply

63
00:04:45,300 --> 00:04:46,540
to JavaScript.

64
00:04:46,710 --> 00:04:51,630
It's just gonna be a slightly different syntax but you're going to pick it up in no time.

65
00:04:51,720 --> 00:04:52,920
No problem.

66
00:04:52,920 --> 00:05:00,290
Trust me in the next part of the module it's going to be back to data science because we're going to

67
00:05:00,290 --> 00:05:02,530
have to pre process some data.

68
00:05:02,690 --> 00:05:03,670
What kind of data.

69
00:05:03,800 --> 00:05:06,500
And why do we need to pre process things.

70
00:05:06,500 --> 00:05:11,780
Well we're gonna have somebody draw a number onto a canvas right.

71
00:05:11,870 --> 00:05:13,460
That's how the website's gonna work.

72
00:05:13,760 --> 00:05:18,490
But drawing this on a canvas will give us an image.

73
00:05:18,680 --> 00:05:23,540
But what we need to give to our tensor flow Jesus model is in fact a tensor.

74
00:05:23,630 --> 00:05:29,280
It's gonna be an array of the pixel values that we've used to train our model on.

75
00:05:29,360 --> 00:05:32,900
So how do we go from an image to a tensor.

76
00:05:32,900 --> 00:05:35,230
And what additional steps do we need to take.

77
00:05:35,270 --> 00:05:41,360
Well we might have to crop the image we might have to scale the pixel values and we're also going to

78
00:05:41,360 --> 00:05:44,940
have to create an actual tensor and much much more.

79
00:05:45,020 --> 00:05:50,420
Now a lot of this work is actually incredibly involved but this is an opportunity to learn about an

80
00:05:50,420 --> 00:05:59,000
incredibly popular machine learning library called Open CV the CV stands for computer vision and open

81
00:05:59,000 --> 00:06:03,030
CV will be the library that will help us work with our images.

82
00:06:03,140 --> 00:06:09,260
It's incredibly powerful and also quite popular because it was originally developed by Intel back in

83
00:06:09,260 --> 00:06:14,980
nineteen ninety nine having pre processed our image data and turn it into a tensor.

84
00:06:14,990 --> 00:06:18,140
We can of course feed it into our tensor flow Jesus model.

85
00:06:18,260 --> 00:06:23,780
And at that point we can make a prediction based on the image and compare it to the correct result.

86
00:06:23,990 --> 00:06:28,280
If the answer is correct our garden will blossom and grow.

87
00:06:28,280 --> 00:06:33,680
And that brings us to the final step which is publishing our Web site.

88
00:06:33,680 --> 00:06:39,350
And the last part of the module we're going to go from working on our local machines and using our local

89
00:06:39,350 --> 00:06:44,570
host to publishing our Web site and giving it a real U.R.L..

90
00:06:44,990 --> 00:06:50,810
I'm going to show you how you can make your website go live on the Internet so that you can send a link

91
00:06:50,870 --> 00:06:57,350
to your friends and family and co-workers and Twitter followers and everybody that you want to show

92
00:06:57,350 --> 00:06:58,520
your product to.

93
00:06:58,520 --> 00:07:01,320
So I hope you're as excited as I am.

94
00:07:01,370 --> 00:07:02,860
I'll see you in the next lesson.

95
00:07:02,870 --> 00:07:03,990
Let's get started.
